﻿(function ($) {
    tablist = {
        newTab: function (item) {
            var dataId = item.id;
            var dataUrl = item.url;
            var menuName = item.title;
            var flag = true;
            if (dataUrl == undefined || $.trim(dataUrl).length == 0) {
                return false;
            }
            $('.menuTab').each(function () {
                if ($(this).data('id') == dataUrl) {
                    if (!$(this).hasClass('active')) {
                        $(this).addClass('active').siblings('.menuTab').removeClass('active');
                        $.learuntab.scrollToTab(this);
                        $('.mainContent .LRADMS_iframe').each(function () {
                            if ($(this).data('id') == dataUrl) {
                                $(this).show().siblings('.LRADMS_iframe').hide();
                                return false;
                            }
                        });
                    }
                    flag = false;
                    return false;
                }
            });
            if (flag) {
                var str = '<a href="javascript:;" class="active menuTab" data-id="' + dataUrl + '">' + menuName + ' <i class="fa fa-remove"></i></a>';
                $('.menuTab').removeClass('active');
                var str1 = '<iframe class="LRADMS_iframe" id="iframe' + dataId + '" name="iframe' + dataId + '"  width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" seamless></iframe>';
                $('.mainContent').find('iframe.LRADMS_iframe').hide();
                $('.mainContent').append(str1);
                Loading(true);
                $('.mainContent iframe:visible').load(function () {
                    Loading(false);
                });
                $('.menuTabs .page-tabs-content').append(str);
                $.learuntab.scrollToTab($('.menuTab.active'));
            }
        }
    }
    $.learuntab = {
        requestFullScreen: function () {
            var de = document.documentElement;
            if (de.requestFullscreen) {
                de.requestFullscreen();
            } else if (de.mozRequestFullScreen) {
                de.mozRequestFullScreen();
            } else if (de.webkitRequestFullScreen) {
                de.webkitRequestFullScreen();
            }
        },
        exitFullscreen: function () {
            var de = document;
            if (de.exitFullscreen) {
                de.exitFullscreen();
            } else if (de.mozCancelFullScreen) {
                de.mozCancelFullScreen();
            } else if (de.webkitCancelFullScreen) {
                de.webkitCancelFullScreen();
            }
        },
        refreshTab: function () {
            var currentId = $('.page-tabs-content').find('.active').attr('data-id');
            var target = $('.LRADMS_iframe[data-id="' + currentId + '"]');
            var url = target.attr('src');
            Loading(true);
            target.attr('src', url).load(function () {
                Loading(false);
            });
        },
        activeTab: function () {
            var currentId = $(this).data('id');
            if (!$(this).hasClass('active')) {
                $('.mainContent .LRADMS_iframe').each(function () {
                    if ($(this).data('id') == currentId) {
                        $(this).show().siblings('.LRADMS_iframe').hide();
                        return false;
                    }
                });
                $(this).addClass('active').siblings('.menuTab').removeClass('active');
                $.learuntab.scrollToTab(this);
            }
        },
        closeOtherTabs: function () {
            $('.page-tabs-content').children("[data-id]").find('.fa-remove').parents('a').not(".active").each(function () {
                $('.LRADMS_iframe[data-id="' + $(this).data('id') + '"]').remove();
                $(this).remove();
            });
            $('.page-tabs-content').css("margin-left", "0");
        },
        closeTab: function () {
            var closeTabId = $(this).parents('.menuTab').data('id');
            var currentWidth = $(this).parents('.menuTab').width();
            if ($(this).parents('.menuTab').hasClass('active')) {
                if ($(this).parents('.menuTab').next('.menuTab').size()) {
                    var activeId = $(this).parents('.menuTab').next('.menuTab:eq(0)').data('id');
                    $(this).parents('.menuTab').next('.menuTab:eq(0)').addClass('active');

                    $('.mainContent .LRADMS_iframe').each(function () {
                        if ($(this).data('id') == activeId) {
                            $(this).show().siblings('.LRADMS_iframe').hide();
                            return false;
                        }
                    });
                    var marginLeftVal = parseInt($('.page-tabs-content').css('margin-left'));
                    if (marginLeftVal < 0) {
                        $('.page-tabs-content').animate({
                            marginLeft: (marginLeftVal + currentWidth) + 'px'
                        }, "fast");
                    }
                    $(this).parents('.menuTab').remove();
                    $('.mainContent .LRADMS_iframe').each(function () {
                        if ($(this).data('id') == closeTabId) {
                            $(this).remove();
                            return false;
                        }
                    });
                }
                if ($(this).parents('.menuTab').prev('.menuTab').size()) {
                    var activeId = $(this).parents('.menuTab').prev('.menuTab:last').data('id');
                    $(this).parents('.menuTab').prev('.menuTab:last').addClass('active');
                    $('.mainContent .LRADMS_iframe').each(function () {
                        if ($(this).data('id') == activeId) {
                            $(this).show().siblings('.LRADMS_iframe').hide();
                            return false;
                        }
                    });
                    $(this).parents('.menuTab').remove();
                    $('.mainContent .LRADMS_iframe').each(function () {
                        if ($(this).data('id') == closeTabId) {
                            $(this).remove();
                            return false;
                        }
                    });
                }
            }
            else {
                $(this).parents('.menuTab').remove();
                $('.mainContent .LRADMS_iframe').each(function () {
                    if ($(this).data('id') == closeTabId) {
                        $(this).remove();
                        return false;
                    }
                });
                $.learuntab.scrollToTab($('.menuTab.active'));
            }
            return false;
        },
        addTab: function () {
            $(".navbar-custom-menu>ul>li.open").removeClass("open");
            $(".sidebar-menu-overlay").remove();
            $(".sidebar-menu").find(".sidebar-menu-right").css("overflow", "hidden");
            $(".sidebar-menu").slideUp(300)

            var dataId = $(this).attr('data-id');
            if (dataId != "") {
                top.$.cookie('currentmoduleId', dataId, { path: "/" });
            }
            var dataUrl = $(this).attr('href');
            var menuName = $.trim($(this).text());
            var flag = true;
            if (dataUrl == undefined || $.trim(dataUrl).length == 0) {
                return false;
            }
            $('.menuTab').each(function () {
                if ($(this).data('id') == dataUrl) {
                    if (!$(this).hasClass('active')) {
                        $(this).addClass('active').siblings('.menuTab').removeClass('active');
                        $.learuntab.scrollToTab(this);
                        $('.mainContent .LRADMS_iframe').each(function () {
                            if ($(this).data('id') == dataUrl) {
                                $(this).show().siblings('.LRADMS_iframe').hide();
                                return false;
                            }
                        });
                    }
                    flag = false;
                    return false;
                }
            });
            if (flag) {
                var str = '<a href="javascript:;" class="active menuTab" data-id="' + dataUrl + '">' + menuName + ' <i class="fa fa-remove"></i></a>';
                $('.menuTab').removeClass('active');
                var str1 = '<iframe class="LRADMS_iframe" id="iframe' + dataId + '" name="iframe' + dataId + '"  width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" seamless></iframe>';
                $('.mainContent').find('iframe.LRADMS_iframe').hide();
                $('.mainContent').append(str1);
                Loading(true);
                $('.mainContent iframe:visible').load(function () {
                    Loading(false);
                });
                $('.menuTabs .page-tabs-content').append(str);
                $.learuntab.scrollToTab($('.menuTab.active'));
            }
            return false;
        },
        scrollTabRight: function () {
            var marginLeftVal = Math.abs(parseInt($('.page-tabs-content').css('margin-left')));
            var tabOuterWidth = $.learuntab.calSumWidth($(".content-tabs").children().not(".menuTabs"));
            var visibleWidth = $(".content-tabs").outerWidth(true) - tabOuterWidth;
            var scrollVal = 0;
            if ($(".page-tabs-content").width() < visibleWidth) {
                return false;
            } else {
                var tabElement = $(".menuTab:first");
                var offsetVal = 0;
                while ((offsetVal + $(tabElement).outerWidth(true)) <= marginLeftVal) {
                    offsetVal += $(tabElement).outerWidth(true);
                    tabElement = $(tabElement).next();
                }
                offsetVal = 0;
                while ((offsetVal + $(tabElement).outerWidth(true)) < (visibleWidth) && tabElement.length > 0) {
                    offsetVal += $(tabElement).outerWidth(true);
                    tabElement = $(tabElement).next();
                }
                scrollVal = $.learuntab.calSumWidth($(tabElement).prevAll());
                if (scrollVal > 0) {
                    $('.page-tabs-content').animate({
                        marginLeft: 0 - scrollVal + 'px'
                    }, "fast");
                }
            }
        },
        scrollTabLeft: function () {
            var marginLeftVal = Math.abs(parseInt($('.page-tabs-content').css('margin-left')));
            var tabOuterWidth = $.learuntab.calSumWidth($(".content-tabs").children().not(".menuTabs"));
            var visibleWidth = $(".content-tabs").outerWidth(true) - tabOuterWidth;
            var scrollVal = 0;
            if ($(".page-tabs-content").width() < visibleWidth) {
                return false;
            } else {
                var tabElement = $(".menuTab:first");
                var offsetVal = 0;
                while ((offsetVal + $(tabElement).outerWidth(true)) <= marginLeftVal) {
                    offsetVal += $(tabElement).outerWidth(true);
                    tabElement = $(tabElement).next();
                }
                offsetVal = 0;
                if ($.learuntab.calSumWidth($(tabElement).prevAll()) > visibleWidth) {
                    while ((offsetVal + $(tabElement).outerWidth(true)) < (visibleWidth) && tabElement.length > 0) {
                        offsetVal += $(tabElement).outerWidth(true);
                        tabElement = $(tabElement).prev();
                    }
                    scrollVal = $.learuntab.calSumWidth($(tabElement).prevAll());
                }
            }
            $('.page-tabs-content').animate({
                marginLeft: 0 - scrollVal + 'px'
            }, "fast");
        },
        scrollToTab: function (element) {
            var marginLeftVal = $.learuntab.calSumWidth($(element).prevAll()), marginRightVal = $.learuntab.calSumWidth($(element).nextAll());
            var tabOuterWidth = $.learuntab.calSumWidth($(".content-tabs").children().not(".menuTabs"));
            var visibleWidth = $(".content-tabs").outerWidth(true) - tabOuterWidth;
            var scrollVal = 0;
            if ($(".page-tabs-content").outerWidth() < visibleWidth) {
                scrollVal = 0;
            } else if (marginRightVal <= (visibleWidth - $(element).outerWidth(true) - $(element).next().outerWidth(true))) {
                if ((visibleWidth - $(element).next().outerWidth(true)) > marginRightVal) {
                    scrollVal = marginLeftVal;
                    var tabElement = element;
                    while ((scrollVal - $(tabElement).outerWidth()) > ($(".page-tabs-content").outerWidth() - visibleWidth)) {
                        scrollVal -= $(tabElement).prev().outerWidth();
                        tabElement = $(tabElement).prev();
                    }
                }
            } else if (marginLeftVal > (visibleWidth - $(element).outerWidth(true) - $(element).prev().outerWidth(true))) {
                scrollVal = marginLeftVal - $(element).prev().outerWidth(true);
            }
            if (scrollVal > 0) {
                scrollVal += 30;
            }
            $('.page-tabs-content').animate({
                marginLeft: 0 - scrollVal + 'px'
            }, "fast");
        },
        calSumWidth: function (element) {
            var width = 0;
            $(element).each(function () {
                width += $(this).outerWidth(true);
            });
            return width;
        },
        init: function () {
            $('.menuItem').on('click', top.$.learuntab.addTab);
            $('.menuTabs').on('click', '.menuTab i', top.$.learuntab.closeTab);
            $('.menuTabs').on('click', '.menuTab', top.$.learuntab.activeTab);
            $('.tabLeft').on('click', top.$.learuntab.scrollTabLeft);
            $('.tabRight').on('click', top.$.learuntab.scrollTabRight);
            $('.tabReload').on('click', top.$.learuntab.refreshTab);
            $('.tabCloseCurrent').on('click', function () {
                $('.page-tabs-content').find('.active i').trigger("click");
            });
            $('.tabCloseAll').on('click', function () {
                $('.page-tabs-content').children("[data-id]").find('.fa-remove').each(function () {
                    $('.LRADMS_iframe[data-id="' + $(this).data('id') + '"]').remove();
                    $(this).parents('a').remove();
                });
                $('.page-tabs-content').children("[data-id]:first").each(function () {
                    $('.LRADMS_iframe[data-id="' + $(this).data('id') + '"]').show();
                    $(this).addClass("active");
                });
                $('.page-tabs-content').css("margin-left", "0");
            });
            $('.tabCloseOther').on('click', $.learuntab.closeOtherTabs);
            $('.fullscreen').on('click', function () {
                if (!$(this).attr('fullscreen')) {
                    $(this).attr('fullscreen', 'true');
                    $.learuntab.requestFullScreen();
                } else {
                    $(this).removeAttr('fullscreen')
                    $.learuntab.exitFullscreen();
                }
            });
        }
    };
    $.learunindex = {
        load: function () {
            $("#content-wrapper").find('.mainContent').height($(window).height() - 158);
            $(window).resize(function (e) {
                $("#content-wrapper").find('.mainContent').height($(window).height() - 158);
            });
            $(window).load(function () {
                window.setTimeout(function () {
                    $('#ajax-loader').fadeOut();
                    Loading(false);
                }, 300);
            });
        },
        jsonWhere: function (data, action) {
            if (action == null) return;
            var reval = new Array();
            $(data).each(function (i, v) {
                if (action(v)) {
                    reval.push(v);
                }
            })
            return reval;
        },
        loadMenu: function () {
            var data = authorizeMenuData;
            var _html = "";
            $.each(data, function (i) {
                var row = data[i];
                if (row.ParentId == "0") {
                    _html += '<li><a href="#" data-id="' + row.ModuleId + '"><i class="fa ' + row.Icon + '"></i><span>' + row.FullName + '</span></a><em></em></li>';
                }
            });
            var $ul = $(".sidebar-menu-left ul").html(_html);
            $ul.find("li").click(function () {
                $ul.find("li.active").removeClass("active");
                $(this).addClass("active");
                var dataId = $(this).find("a").attr("data-id");
                var childNodes = $.learunindex.jsonWhere(data, function (v) { return v.ParentId == dataId });
                var _childNodeshtml = "";
                $.each(childNodes, function (i) {
                    var row = childNodes[i];
                    var subchildNodes = $.learunindex.jsonWhere(data, function (v) { return v.ParentId == row.ModuleId });
                    if (subchildNodes.length > 0) {
                        _childNodeshtml += '<li>';
                        _childNodeshtml += '<a href="#"><i class="fa ' + row.Icon + '"></i><span>' + row.FullName + '</span><i class="fa fa-angle-left pull-right"></i></a>';
                        _childNodeshtml += '<ul>';
                        $.each(subchildNodes, function (i) {
                            var subrow = subchildNodes[i];
                            _childNodeshtml += '<li><a class="menuItem" data-id="' + subrow.ModuleId + '" href="' + subrow.UrlAddress + '"><i class="fa ' + subrow.Icon + '"></i><span>' + subrow.FullName + '</span></a></li>';
                        });
                        _childNodeshtml += '</ul>';
                        _childNodeshtml += '</li>';

                    } else {
                        _childNodeshtml += '<li><a class="menuItem" data-id="' + row.ModuleId + '" href="' + row.UrlAddress + '"><i class="fa ' + row.Icon + '"></i><span>' + row.FullName + '</span></a></li>';
                    }
                });
                var $subul = $(".sidebar-menu-right>ul").html(_childNodeshtml);
                $subul.find(">li").click(function () {
                    var e = $(this);
                    if (e.find("ul>li").length > 0) {
                        if (e.find("ul").is(":visible")) {
                            e.find("ul").slideUp(500)
                            e.find(">a").removeClass("active")
                        } else {
                            $subul.find("ul").slideUp(500)
                            $subul.find(">li>a").removeClass("active");
                            e.find("ul").slideDown(500);
                            e.find(">a").addClass("active")
                        }
                    }
                });
                $.learuntab.init();
            });
            $ul.find("li:first").trigger("click");
            //开始菜单
            $(".start_menu").click(function () {
                if (!$(".sidebar-menu").is(":visible")) {
                    $(".sidebar-menu").find(".sidebar-menu-right").css("overflow", "auto");
                    $(".sidebar-menu").show();
                    $("body").prepend('<div class="sidebar-menu-overlay" style="display: block;"></div>');
                    $(".sidebar-menu-overlay").click(function () {
                        $(this).remove();
                        $(".sidebar-menu").find(".sidebar-menu-right").css("overflow", "hidden");
                        $(".sidebar-menu").slideUp(300)
                    })
                }
            });
        },
        loadDesktop: function () {
            if ($(".slidebox").length > 0) {
                var data = [{ "ModuleId": "4efd37bf-e3ef-4ced-8248-58eba046d78c", "ParentId": "1", "EnCode": "PzManage", "FullName": "凭证列表", "Icon": "fa fa-bars", "UrlAddress": "/CustomerManage/Pz/Index", "Target": "iframe", "IsMenu": 1, "AllowExpand": 1, "IsPublic": 0, "AllowEdit": null, "AllowDelete": null, "SortCode": 1, "DeleteMark": 0, "EnabledMark": 1, "Description": null, "CreateDate": null, "CreateUserId": null, "CreateUserName": null, "ModifyDate": "2015-11-17 11:22:46", "ModifyUserId": "System", "ModifyUserName": "超级管理员" }, { "ModuleId": "f1aebb27-0f42-4234-ac0d-96e33009b325", "ParentId": "ad147f6d-613f-4d2d-8c84-b749d0754f3b", "EnCode": "ImportManage", "FullName": "凭证导入", "Icon": "fa fa-file-excel-o", "UrlAddress": "/CustomerManage/Import/Index", "Target": "iframe", "IsMenu": 1, "AllowExpand": 1, "IsPublic": 0, "AllowEdit": null, "AllowDelete": null, "SortCode": 1, "DeleteMark": 0, "EnabledMark": 1, "Description": null, "CreateDate": null, "CreateUserId": null, "CreateUserName": null, "ModifyDate": "2015-11-17 11:22:46", "ModifyUserId": "System", "ModifyUserName": "超级管理员" }, { "ModuleId": "4efd37bf-e3ef-4ced-8248-58eba046d78d", "ParentId": "1", "EnCode": "PzManage", "FullName": "新增凭证", "Icon": "fa fa-edit", "UrlAddress": "/CustomerManage/Pz/Form", "Target": "iframe", "IsMenu": 1, "AllowExpand": 1, "IsPublic": 0, "AllowEdit": null, "AllowDelete": null, "SortCode": 1, "DeleteMark": 0, "EnabledMark": 1, "Description": null, "CreateDate": null, "CreateUserId": null, "CreateUserName": null, "ModifyDate": "2015-11-17 11:22:46", "ModifyUserId": "System", "ModifyUserName": "超级管理员" }, { "ModuleId": "4efd37bf-e3ef-4ced-8248-58eba046d78b", "ParentId": "1", "EnCode": "DataItemManage", "FullName": "通用字典", "Icon": "fa fa-book", "UrlAddress": "/SystemManage/DataItemDetail/Index", "Target": "iframe", "IsMenu": 1, "AllowExpand": 1, "IsPublic": 0, "AllowEdit": null, "AllowDelete": null, "SortCode": 2, "DeleteMark": 0, "EnabledMark": 1, "Description": "通用数据字典", "CreateDate": "2015-11-12 14:37:04", "CreateUserId": "System", "CreateUserName": "超级管理员", "ModifyDate": "2016-04-29 14:06:26", "ModifyUserId": "System", "ModifyUserName": "超级管理员" }, { "ModuleId": "f21fa3a0-c523-4d02-99ca-fd8dd3ae3d59", "ParentId": "1", "EnCode": "SystemLog", "FullName": "系统日志", "Icon": "fa fa-warning", "UrlAddress": "/SystemManage/Log/Index", "Target": "iframe", "IsMenu": 1, "AllowExpand": 1, "IsPublic": 0, "AllowEdit": null, "AllowDelete": null, "SortCode": 6, "DeleteMark": 0, "EnabledMark": 1, "Description": "登录日志、操作日志。异常日志", "CreateDate": "2015-11-12 15:04:58", "CreateUserId": "System", "CreateUserName": "超级管理员", "ModifyDate": "2016-04-29 14:12:14", "ModifyUserId": "System", "ModifyUserName": "超级管理员" }, { "ModuleId": "dec79ca7-3b54-432a-be1e-c96e7a2c7150", "ParentId": "ad147f6d-613f-4d2d-8c84-b749d0754f3b", "EnCode": "BalanceReport", "FullName": "余额表", "Icon": "fa fa-bar-chart", "UrlAddress": "/ReportManage/ReportBalance/Index", "Target": "iframe", "IsMenu": 1, "AllowExpand": 1, "IsPublic": 0, "AllowEdit": null, "AllowDelete": null, "SortCode": 9, "DeleteMark": 0, "EnabledMark": 1, "Description": "收支报表", "CreateDate": "2016-04-28 15:12:16", "CreateUserId": "System", "CreateUserName": "超级管理员", "ModifyDate": "2016-05-27 16:29:15", "ModifyUserId": "System", "ModifyUserName": "超级管理员" }, { "ModuleId": "ddce0dc1-3345-41b7-9716-22641fbbfaed", "ParentId": "6", "EnCode": "DetailReport", "FullName": "明细账", "Icon": "fa fa-pie-chart", "UrlAddress": "/ReportManage/ReportDetail/Index", "Target": "iframe", "IsMenu": 1, "AllowExpand": 0, "IsPublic": 0, "AllowEdit": null, "AllowDelete": null, "SortCode": 9, "DeleteMark": 0, "EnabledMark": 1, "Description": null, "CreateDate": "2016-03-22 16:55:20", "CreateUserId": "eab01522-f4fe-48ce-8db6-76fd7813cdf5", "CreateUserName": "", "ModifyDate": "2016-03-29 16:53:54", "ModifyUserId": "System", "ModifyUserName": "超级管理员" }, { "ModuleId": "ddce0dc1-3345-41b7-9716-22641fbbfaed", "ParentId": "6", "EnCode": "AjhReport", "FullName": "案号信息表", "Icon": "fa fa-file", "UrlAddress": "/ReportManage/ReportAjh/Index", "Target": "iframe", "IsMenu": 1, "AllowExpand": 0, "IsPublic": 0, "AllowEdit": null, "AllowDelete": null, "SortCode": 9, "DeleteMark": 0, "EnabledMark": 1, "Description": null, "CreateDate": "2016-03-22 16:55:20", "CreateUserId": "eab01522-f4fe-48ce-8db6-76fd7813cdf5", "CreateUserName": "", "ModifyDate": "2016-03-29 16:53:54", "ModifyUserId": "System", "ModifyUserName": "超级管理员" }];
                var color = ["2e99d4", "fe8977 ", "9dd6d7  ", "b5adab", "8ebdd4", "edd46e", "64cfa7", "FFA300", "708FE3", "D972E3", "56BD4E", "1ABC9C", "2e99d4"]
                var _html = "";
                $.each(data, function (i) {
                    var row = data[i];
                    if (row.Target == "iframe") {
                        var colorindex = Math.round(Math.random() * 9 + 1);
                        _html += '<li class="menuItem" data-id="' + row.ModuleId + '" href="' + row.UrlAddress + '">';
                        _html += '    <div class="icon" style="background: #' + color[colorindex] + ';">';
                        _html += '        <i class="fa ' + row.Icon + '"></i>';
                        _html += '     </div>';
                        _html += '     <div class="icon-text">';
                        _html += '         <span>' + row.FullName + '</a>';
                        _html += '     </div>';
                        _html += '</li>';
                    }
                });
                $(".slidebox ul").append(_html);
                var ul = $(".slidebox > ul");
                var lis = ul.children("li");
                lis.each(function (i, dom) {
                    if (i % 28 == 0) {
                        ul.before('<ul>');
                    }
                    ul.prev("ul").append(dom);
                });
                ul.remove();

                var slideboxCount = Math.ceil($(".slidebox>ul>li").length / 28);
                for (var i = 0; i < slideboxCount; i++) {
                    $(".slidebox-slider ul").prepend('<li><i class="fa fa-circle"></i></li>');
                }
                $(".slidebox-slider ul li:first").addClass("active");
                $(".slidebox-slider ul li").click(function () {
                    $(".slidebox-slider ul li").removeClass("active");
                    $(this).addClass("active");
                    var index = $(this).index();
                    $(".slidebox").animate({ "left": -$(".slidebox>ul").width() * index }, 1000);
                });
                $(".slidebox>ul").width($(".slidebox").width());
                $(".slidebox").width($(".slidebox").width() * $(".slidebox>ul").length);
            }
        },
        indexOut: function () {
            dialogConfirm("注：您确定要安全退出本次登录吗？", function (r) {
                if (r) {
                    Loading(true, "正在安全退出...");
                    window.setTimeout(function () {
                        $.ajax({
                            url: contentPath + "/Login/OutLogin",
                            type: "post",
                            dataType: "json",
                            success: function (data) {
                                window.location.href = contentPath + "/Login/Index";
                            }
                        });
                    }, 500);
                }
            });
        }
    };
})(jQuery);